package com.py.gs.businese.chatcheck;

import java.util.Random;

/**
 * int[] 比 boolean[] 操作效率更高 ？
 * 
 * @author cyd
 * @date 2018年4月23日
 */
public class Test {

	public static void main(String[] args) {
		int[] indexs = new int[]{18837,55440,31023,21936,39050,51872,50708,34558,26356,11102,4278,62642,6355,21579,60171,4838,4976,45860,33059,32008,819,35561,12388,31178,40580,20834,56811,48361,47472,9117,11307,33379,31054,62186,33417,7413,35338,24871,43153,23682};
		Random random = new Random();
		for (int i = 0; i < indexs.length; i++) {
			indexs[i] = random.nextInt((int)Character.MAX_VALUE);
		}
		System.out.println((int)Character.MAX_VALUE);

		int[] intArr = new int[(int)Character.MAX_VALUE];
		long begin1 = System.currentTimeMillis();
		for (int i = 0; i < 10000; i++) {
			for (int j = 0; j < 50000; j++) {
				for (int j2 = 0; j2 < indexs.length; j2++) {
					intArr[indexs[j2]] = 0;
				}
			}
		}
		long end1 = System.currentTimeMillis();
		System.out.println(end1 - begin1);
		
		boolean[] boolArr = new boolean[(int)Character.MAX_VALUE];
		long begin = System.currentTimeMillis();
		for (int i = 0; i < 10000; i++) {
			for (int j = 0; j < 50000; j++) {
				for (int j2 = 0; j2 < indexs.length; j2++) {
					boolArr[indexs[j2]] = false;
				}
			}
		}
		long end = System.currentTimeMillis();
		System.out.println(end - begin);
	}
}
